home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1986 June / Ahoy_Magazine_86-06_1986_Double_L.d64 / missing letters < prev    next >
Text File  |  2022-10-26  |  2KB  |  64 lines

  1. MISSING LETTERS
  2.  
  3. by Captain COMAL
  4.  
  5. Many people are not aware of the
  6. handy string search facility built
  7. into all versions of COMAL. This is
  8. accomplished with the keyword IN.
  9. This missing letter puzzle program
  10. demonstrates how easy this is. The
  11. program is a complete puzzle system,
  12. including routines to create the file
  13. needed as well as read back and
  14. display the puzzle text.
  15.  
  16. The program checks the disk status
  17. after the puzzle file is opened. If
  18. the status is not "00" (for OK) the
  19. create procedure is executed. This
  20. could be modified to check only for
  21. status "62" (file not found). As
  22. listed, any error sends you to the
  23. create file routine which inputs text
  24. you type in (up to 39 letters) and
  25. writes it to the puzzle data file. It
  26. counts the entries as you go. Hit
  27. RETURN on a blank line to stop. For
  28. example, you might type:
  29.  
  30. Programmer's Paradise Package
  31.  
  32. Playing the game consists of several
  33. steps. First it reads a random number
  34. of text lines from the file. It knows
  35. exactly how many are in the file from
  36. the variable COUNT. Next it prints
  37. the text on the screen, replacing
  38. some of the letters with a dash (-).
  39. Finally, it allows the player to type
  40. in the entire text message (incorrect
  41. letters are ignored). I have included
  42. an example RUN about half way through
  43. the puzzle immediately after the
  44. program listing.
  45.  
  46. You can customize and expand this
  47. program to fit your needs. Try
  48. changing the letters the program
  49. hides with a dash (see line 550). It
  50. looks for the vowels now. Replace the
  51. "aeiou" with any other letters. Or
  52. even make it a variable - just add
  53. line 545 and change line 550. For
  54. example:
  55.  
  56. 0545 input "Letters to hide: ":hide$
  57. 0550 if text$(letter) in hide$ then
  58.  
  59. Then, in COMAL 0.14, remember to DIM
  60. the variable HIDE$ at the top of the
  61. program:
  62.  
  63. 0045 dim hide$ of 26
  64.